home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
118_01.zip
/
STORAGE.BDS
< prev
next >
Wrap
Text File
|
1993-06-03
|
2KB
|
89 lines
/* Storage management routines for Software Tools & BDS C.
* source: storage.bds
* version: August 27, 1981
*/
#include tools.h
/* The only routine whose calling sequence has been
* changed is dsinit:
*
* RATFOR: dsinit (w)
* int w;
*
*
* C: dsinit ();
*
*/
/* dsinit -- initialize the dynamic storage space */
dsinit()
{
/* reserve 1000 bytes for stack at all times */
rsvstk(1000);
/* anchor the free memory space */
_allocp = NULL;
}
/* dsfree -- return a block to the available space list */
dsfree (block)
char *block;
{
free(block);
}
/* dsget -- get pointer to block of n bytes */
char *dsget (n)
int n;
{
char *p;
/* comment out -----
printf("In dsget: n = %d\n", n);
----- end comment out */
if ((p = alloc(n)) == 0) {
error ("dsget: out of dynamic memory");
}
return(p);
}
/* ---------- dsdump not implemented:
/* dsdump --- produce semi-readable dump of storage */
dsdump (form)
char form;
{
}
---------- end comment out */
/* ---------- dsdbiu not implemented:
/* dsdbiu - dump contents of block-in-use */
dsdbiu (b, form)
pointer b;
char form;
{
}
---------- end comment out */
n", n);
----- end comment out */
if ((p = alloc(n)) == 0) {
error ("dsget: out of dynamic memory");
}
return(p);
}
/* ---------- dsdump not implemented:
/* dsdump --- produce semi-readable dump of storage */
dsdump (form)
char f